//
//  JoinViewController.h
//  Gruphoto
//
//  Created by Thao Nguyen Huy on 1/4/13.
//  Copyright (c) 2013 CNC Software. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <SDWebImage/UIImageView+WebCache.h>
#import <SDWebImage/SDWebImageManager.h>

@class Event;

@interface JoinViewController : UIViewController  <UISearchBarDelegate, UITableViewDataSource, UITableViewDelegate, UIAlertViewDelegate, UITextFieldDelegate, ASIHTTPRequestDelegate, SDWebImageDownloaderDelegate, SDWebImageManagerDelegate, SDImageCacheDelegate> {
    UISearchBar *joinSearchBar;
    UITableView *joinTableView;
    UIView *maskView;
    
    NSMutableArray *joinableEvents;
    NSMutableArray *eventsNeedDisplay;
    Event *selectedEvent;
}

@property (nonatomic, retain) IBOutlet UISearchBar *joinSearchBar;
@property (nonatomic, retain) IBOutlet UITableView *joinTableView;
@property (nonatomic, retain) IBOutlet UIView *maskView;

@property (nonatomic, retain) NSMutableArray *joinableEvents;
@property (nonatomic, retain) NSMutableArray *eventsNeedDisplay;
@property (nonatomic, retain) Event *selectedEvent;

- (IBAction)mapButtonPressed:(id)sender;
- (IBAction)cancelButtonPressed:(id)sender;
- (IBAction)maskViewTapped:(id)sender;
- (void)showAlertPassword;
- (void)getJoinableEvents;
- (void)getDetailsOfEventWithId:(NSInteger)eventId andStatus:(NSString *)status;

// for searching
- (void)resetSearch;
- (void)handleSearchForTerm:(NSString *)searchTerm;

@end
